const DebianInstaller = require('./debInstaller')
const RedhatInstaller = require('./rpmInstaller')


module.exports = async config => {
  const target = config.target
  const task = []
  if (typeof target === 'string') {
    if ("deb" === target) {
      task.push(DebianInstaller(config))
    } else if ("rpm" === target) {
      task.push(RedhatInstaller(config))
    } else {

    }
  } else if (target.constructor === Array) {
    for (const targetElement of target) {
      if ("deb" === target) {
        task.push(DebianInstaller(config))
      } else if ("rpm" === target) {
        task.push(RedhatInstaller(config))
      } else {

      }
    }
  } else {

  }
  return Promise.all(task)
}
